<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2023-07-23
  Time: 15:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link href="layui/css/layui.css" rel="stylesheet">
    <script src="layui/layui.js"></script>
</head>
<body>
<div class="layui-container" style="margin-top: 30px;">

    <div class="layui-card" style="width: 400px; margin: 0 auto;">
        <div class="layui-card-header" style="font-size: 20px;font-weight: bolder">部门信息编辑</div>
        <div class="layui-card-body">
            <div class="layui-form-item">
                <label class="layui-form-label">部门编号</label>
                <div class="layui-input-block">
                    <input id="deptno" type="text" class="layui-disabled layui-input" style="width: 300px;"disabled>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">部门名</label>
                <div class="layui-input-block">
                    <input id="dname" type="text" class="layui-input" style="width: 300px;">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">部门地址</label>
                <div class="layui-input-block">
                    <input id="loc" type="text" class="layui-input" style="width: 300px;">
                </div>
            </div>
            <div class="layui-form-item" style="text-align: center;">
                <button class="layui-btn layui-bg-orange" style="width: 100px;" onclick="save()">保存</button>
            </div>
        </div>
    </div>

</div>
</body>
<script src="js/jquery-3.6.4.min.js"></script>
<script>
    function save(){
        if($("#dname").val()===""||$("#loc").val()===""){
            alert("您还有未填写的选项");
            return;
        }
        var index=parent.layer.getFrameIndex(window.name);
        window.parent.editDept($("#deptno").val(),$("#dname").val(),$("#loc").val());
        parent.layer.close(index);
    }
</script>
</html>
